<include file="Public:header" />
<link type="text/css" rel="stylesheet" href="/Public/Admin/css/admin/shapan.css" />
<link type="text/css" rel="stylesheet" href="__JS__/imgList/css/style.css" />
<div class="main">
<include file="House:nav" />
<div>
    <div class="n_house_show03 overflow_h">
        <div class="n_house_show03_l">
            <div class="banner">
                <div class="large_box">
                    <ul>
                        <volist name='newPic' key='k' id='vo'>
                            <li <php>if($k>1){</php> style="display: none;"<php>}</php> >
                                <img src="{$vo.img}" width="530" height="350">
                            </li>
                        </volist>
                    </ul>
                </div>
                <div class="small_box">
                    <span class="btn left_btn"></span>
                    <div class="small_list">
                        <ul>
                            <volist name='newPic' id='vo'>
                                <li <php>if(!$key){</php> class="on" <php>}</php> >
                                <img src="{$vo.img}" width="110" height="73">
                                <div class="bun_bg"><div class="img_style"><a target="_blank" href="{:U('House/pic',array('hid'=>$house['id'],'cate'=>$key))}">{$vo.name}</a></div></div>
                                </li>
                            </volist>
                        </ul>
                    </div>
                    <span class="btn right_btn"></span>
                </div>
            </div>
        </div>
        <div class="n_house_show03_r">
            <h2><a title="{$house.title}" href="{:U('House/detail',array('id'=>$house['id']))}">{$house.short_title}</a></h2>
            <div class="b_div02 overflow_h">
                <volist name='tags' id='vo'>
                    <a target="_blank" href="{:U('House/index',array('tags'=>$vo))}"><span class="body_div01_span">{$menu[6][$vo]}</span></a>
                </volist>
            </div>
            <p><span class="n_show03_01"><a title="{$house.title}价格趋势" href="{:U('House/price',array('hid'=>$house['id']))}">趋势</a></span><span class="text06">参考均价：</span><span class="text07">{$house.average_price}</span>元/㎡ </p>
            <p><span class="text06">楼盘优惠：</span>{$house.discount}</p>
            <p><span class="text06">团购优惠：</span>{$house['is_group'] ? $house['group_discount'] : '暂无团购'}</p>
            <p><span class="text06">主推户型：</span>
                <volist name="house_type" id='val'>
                    <a target="_blank" title="{$val.name}" href="{:U('House/typeShow',array('hid'=>$house['id'],'id'=>$val['id']))}">{$val.room}室({$val.area}㎡)</a> |
                </volist>
                <a href="{:U('House/type',array('hid'=>$house['id']))}">全部户型</a></p>
            <p class="overflow_h"><span class="body_span"><span class="text06">地址：</span><span style="color: #cccccc">[{$address[0]}]</span>{$address[1]}</span><span class="map_span"><a title="{$house.title}交通地图" target="_blank" href="{:U('Map/index',array('hid'=>$house['id'],'type'=>'house'))}" class="map_span01">地图</a></span></p>
            <p><span class="text06">开盘时间：</span>{$house.open_time|date='Y-m-d',###} <span class="text06">交房时间：</span>{$house.room_time|date='Y-m-d',###}</p>

            <div class="n_show03_02 overflow_h"><h1><span class="body_span"><span class="text06">免费咨询热线：</span><span class="text10">{$tel[0]}</span><php>if($tel[1]){</php> 转 <span class="text10">{$tel[1]}</span><php>}</php></span><span class="b_div_r02"><a class="free_phone" request-url="{:U('Ajax/houseTel',array('id'=>$house['id']))}" href="javascript:;">免费电话</a></span></h1></div>
        </div>
    </div>

    <php>if($house['coupons']){</php>
    <div class="n_house_show04 overflow_h">
        <div class="house_coupons">
            <div class="coupons_div_1"><span>独家优惠</span></div>
            <div class="coupons_div_2">
                <p>{$house.coupons}</p>
            </div>
        </div>
    </div>
    <php>}</php>
    <div class="n_house_show04 overflow_h">
        <div class="n_house_show04_l">
            <input type="hidden" class="inp02" id="type" value="{$house['is_group'] ? '4' : '2' }" />
            <h1 class="n_h_title"><span class="s_bg_line">{$house['is_group'] ? '团购报名' : '报名看房' }</span></h1>
            <p><input name="name" type="text" class="inp02" id="name" value="姓名" /></p>
            <p><input name="phone" type="text" class="inp02" id="phone" value="手机号" /><a href="javascript:;" id="bmBut" class="but14">立即报名</a></p>
        </div>
        <div class="n_house_show04_r">
            <h1 class="n_h_title"><span class="s_bg_line">楼盘动态</span><span class="more"><a title="{$house.title}动态" href="{:U('House/news',array('hid'=>$house['id']))}">更多</a></span></h1>
            <volist name='news' id='vo'>
                <h2><span class="time">{$vo.add_time|date='Y-m-d',###}</span><span class="n_box" style="width:auto;padding: 0px 8px;">{$news_cate[$vo['cate_id']]}</span><a target="_blank" title="{$vo.title}" href="{:U('News/detail',array('id'=>$vo['id']))}">{$vo.title}</a></h2>
                <p>{:msubstr($vo['desc'],0,108)}</p>
            </volist>
        </div>
    </div>

    <div class="n_house_show05">
        <h1 class="n_h_title"><span class="s_bg_line">户型</span><span class="more">
            <volist name="house_type_nav['list']" id='vo'>
               &nbsp; <a title="{$key}居室" href="{:U('House/type',array('hid'=>$house['id'],'cate'=>$key))}">{$key}居室({$vo})</a> ｜
            </volist>
            <a href="{:U('House/type',array('hid'=>$house['id']))}">更多</a>
        </span></h1>
        <ul class="overflow_h">
            <volist name='house_type_list' id='vo'>
                <li <php>if($key==4){</php> style="margin-right:0" <php>}</php> >
                    <span class="n_house_show05_img"><a href="{:U('House/type',array('hid'=>$house['id'],'id'=>$vo['id']))}"><img alt="{$vo.name}" title="{$vo.name}" src="{$vo.img}" width="210" height="168" /></a></span>
                    <h2><a title="{$vo.name}" href="{:U('House/type',array('hid'=>$house['id'],'id'=>$vo['id']))}">{$vo.name}</a></h2>
                    <p>{$vo.room}室{$vo.hall}厅{$vo.toilets}卫{$vo.balcony}阳台{$vo.kitchen}厨 {$vo.area}㎡</p>
                </li>
            </volist>
        </ul>
    </div>
    <php>if($property_img['img']){</php>
    <div class="n_house_show06">
        <h1 class="n_h_title"><span class="s_bg_line">楼栋</span></h1>
        <div class="n_house_show06_b overflow_h">
            <div class="n_house_show06_b_l" id="shapan" style="overflow:hidden; width:738px; height:424px;position:relative;border:2px solid #CAE4F7">
                <div id="shapan-i">
                    <img id="MapImages" src="{$property_img.img}" />
                    <volist name="property_data['val']" id='vo'>
                        <php>
                            $v = explode(',',$vo);
                        </php>
                    <a href="javascript:;" data-shapan="{$vo}" data-bid="{$key}" class="sha-dot sha-dot-{$property_data['status'][$key]}" title="{$property_data['title'][$key]}" style="left: {$v[0]}px; top: {$v[1]}px;"><i></i>{$property_data['title'][$key]}</a>
                    </volist>
                </div>
            </div>
            <div class="n_house_show06_b_r">
                <div class="maptck" style="position: absolute">
                    <dl class="mttitle">
                        <dt>{$house.title}</dt>
                        <dd><a></a></dd>
                    </dl>
                    <div class="mtalone">
                        <ul>
                            <li class="mtaico kpsj"></li>
                            <li>开盘时间：<span id="opening_time"></span></li>
                        </ul>
                        <ul>
                            <li class="mtaico jfsj"></li>
                            <li>入住时间：<span id="check_in_time"></span></li>
                        </ul>
                    </div>
                    <div class="mtalone">
                        <ul>
                            <li class="mtaico dy"></li>
                            <li><span class="mtmr24">单</span>元：<span id="unit"></span></li>
                        </ul>
                        <ul>
                            <li class="mtaico cs"></li>
                            <li><span class="mtmr24">层</span>数：<span id="floor"></span>层</li>
                        </ul>
                    </div>
                    <div class="mtalone">
                        <ul>
                            <li class="mtaico hs"></li>
                            <li><span class="mtmr24">户</span>数：共<span id="households"></span>户</li>
                        </ul>
                        <ul>
                            <li class="mtaico thpb"></li>
                            <li>梯户配比：<span id="stairs"></span></li>
                        </ul>
                    </div>
                    <dl class="mthx">
                        <dt>
                            <div class="wtafl mtaico hx"></div>
                            <div class="wtafl"><span class="mtmr24">户</span>型：</div>
                        </dt>
                        <dd>
                            <ul id="house_type_show"></ul>
                        </dd>
                    </dl>
                </div>
                <h1>户型列表</h1>
                <div class="n_r01">
                    <ul>
                        <volist name="house_type_nav['list']" id='vo'>
                            <li data-id="{$key}"><a href="javascript:;" >{$numTurnCn[$key]}居({$vo})</a></li>
                        </volist>
                    </ul>
                </div>
                <div class="n_r02">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" id="room_show">
                        <volist name="house_type_nav_list" id='vo'>
                            <tr>
                                <td height="37"><a title="{$vo.name}" href="{:U('House/typeShow',array('hid'=>$house['id'],'id'=>$vo['id']))}">{$vo.name}</a></td>
                                <td height="37">{$vo.room}室{$vo.hall}厅{$vo.toilets}卫{$vo.balcony}阳台{$vo.kitchen}厨</td>
                                <td height="37">{$vo.area}㎡</td>
                            </tr>
                        </volist>
                    </table>
                </div>

            </div>

        </div>
    </div>
    <php>}</php>
    <php>
        if($house['map']){
        $map = explode(',',$house['map']);
    </php>
    <div class="n_house_show07">
        <h1 class="n_h_title"><span class="s_bg_line">周边配套</span><span class="more"><a target="_blank" href="{:U('Map/index',array('hid'=>$house['id'],'type'=>'house'))}">更多</a></span></h1>
        <div class="n_house_show06_b overflow_h">
            <iframe width="100%" height="auto" frameborder="0" scrolling="no" src="{:U('Api/map',array('id'=>$house['id'],'model'=>'house'))}" id="main" style="height: 500px;"></iframe>
        </div>
    </div>
    <php>}</php>
    <div class="n_house_show08 overflow_h">
        <h1 class="n_h_title"><span class="s_bg_line">楼盘相册</span><span class="more">
           <volist name="menu[5]" id='vo'>
               &nbsp; <a title="{$vo}" href="{:U('House/pic',array('hid'=>$house['id'],'cate'=>$key))}">{$vo}</a> ｜
           </volist>
            <a href="{:U('House/pic',array('hid'=>$house['id']))}">更多</a>
        </span></h1>
        <ul>
            <volist name='house_pic' id='vo'>
            <li <php>if($key==4){</php> style="margin-right:0" <php>}</php> ><span class="n_house_show08_img"><div class="buy_t1"><h1><a href="{:U('House/pic',array('hid'=>$house['id']))}">{$vo.title}</a></h1></div><a href="{:U('House/pic',array('hid'=>$house['id']))}"><img src="{$vo.img}" width="220" height="165" /></a></span></li>
            </volist>
        </ul>
    </div>

    <div class="n_house_show08 overflow_h">
        <h1 class="n_h_title"><span class="s_bg_line">猜你喜欢</span></h1>
        <ul>
            <volist name='rec_house' id='vo'>
            <li <php>if($key==4){</php> style="margin-right:0" <php>}</php> ><span class="n_house_show08_img"><a href="{:U('House/detail',array('id'=>$vo['id']))}"><img alt="{$vo.title}" title="{$vo.title}" src="{$vo.img}" width="220" height="165" /></a></span><h2><a href="{:U('House/detail',array('id'=>$vo['id']))}">{$vo.title}</a></h2><p><span class="text08">{$vo.average_price}</span>元/㎡</p>
                <div class="b_div02 ">
                    {$vo['group_discount'] ? $vo['group_discount'] : $vo['discount']}
                </div>
            </li>
            </volist>
        </ul>
    </div>

    <div class="n_house_show09">
        <h1 class="n_h_title"><span class="s_bg_line">{$house.title}</span></h1>
        <div class="n_house_show09_1 overflow_h">
            <span class="n_house_show09_sp">附近楼盘</span>
            <ul>
                <volist name='nearby_house' id='vo'>
                    <li><a title="{$vo.title}" href="{:U('House/detail',array('id'=>$vo['id']))}">{$vo.title}</a></li>
                </volist>
            </ul>
        </div>

        <div class="n_house_show09_1 overflow_h">
            <span class="n_house_show09_sp">热门楼盘</span>
            <ul>
                <volist name='hits_house' id='vo'>
                    <li><a title="{$vo.title}" href="{:U('House/detail',array('id'=>$vo['id']))}">{$vo.title}</a></li>
                </volist>
            </ul>
        </div>

    </div>
    <div class="n_house_show09_2"><p><strong>免责声明：</strong> {$explain.house}</p></div>

</div>
</div>
<input type="hidden" id="house_id" value="{$house.id}">
<script type="text/javascript" src="__JS__/jquery.js"></script>
<script type="text/javascript" src="__JS__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/public.js"></script>
<script type='text/javascript' src='__S__/js/jqmodal.js'></script>
<script type="text/javascript" src="__JS__/imgList/js/carousel.min.js"></script>
<script type="text/javascript">
    $(function(){
        /* 商品轮播图（带缩略图的轮播效果） */
        $(".banner").thumbnailImg({
            large_elem: ".large_box",
            small_elem: ".small_list",
            left_btn: ".left_btn",
            right_btn: ".right_btn"
        });
    });
    $("#houseKey").fangCmsText();
    $("#phone").fangCmsText();
    $("#name").fangCmsText();
    $(".n_r01 li:first").addClass('selected');
    $(".n_r01 li").click(function(){
        $(".n_r01 li").removeClass('selected');
        $(this).addClass('selected');
        //请求ajax
        $.ajax({
            type: "post",
            url : "{:U('Ajax/houseTypeRoom')}",
            dataType:'json',
            data:{house_id:$("#house_id").val(),room:$(this).attr('data-id'),type:1},
            success: function(json){
                if(json.status==1){
                     $("#room_show").empty();
                     $("#room_show").append(json.data);
                }else{
                    msg_show(json.msg,2)
                }
            }
        });
    });

    $("#bmBut").click(function(){
        var phone = $("#phone").val();
        if($("#type").val()==''){
            msg_show('报名类型不对',2);
            return false;
        }
        if($("#name").val()=='' || $("#name").val()=='姓名'){
            msg_show('姓名不能为空',2);
            return false;
        }
        var pattern = /0?(13|14|15|17|18)[0-9]{9}/;
        if(phone=='' || phone=='手机号' || !pattern.test(phone)){
            msg_show('请输入正确的手机号码',2);
            return false;
        }
        //请求ajax
        $.ajax({
            type: "post",
            url : "{:U('Ajax/orderHouse')}",
            dataType:'json',
            data:{house_id:$("#house_id").val(),name:$("#name").val(),phone:phone,type:$("#type").val()},
            success: function(json){
                if(json.status==1){
                    msg_show(json.msg,1)
                }else{
                    msg_show(json.msg,2)
                }
            }
        });
    });

    //沙盘处理
    $('#shapan-i').jqDrag({
        attachment:'#shapan'
    });
    $(".sha-dot").click(function(){
        var id = $(this).attr('data-bid');
        //请求ajax
        $.ajax({
            type: "post",
            url : "{:U('Ajax/getProperty')}",
            dataType:'json',
            data:{house_id:$("#house_id").val(),id:id},
            success: function(json){
                if(json.status==1){
                    $("#house_type_show").empty();
                    $(".mttitle dt").html(json.property.title);
                    $.each(json.property, function(i,v) {
                       $("#"+i).html(v);
                    });
                    var str = json.str ? json.str : '<li>找不到对应的户型</li>';
                    $("#house_type_show").append(str);
                    $(".maptck").show();
                }else{
                    msg_show(json.msg,2)
                }
            }
        });
    });
    $(".mttitle dd").click(function(){
        $(".maptck").hide();
    });

</script>
<include file="Public:footer" />